
#include "EK.h"

using namespace std;

int baseline(string file){
    int successNum = 0,M0Size;
    M0Size = oblivious_M(file);
    for (int i = 0; i < M0Size; i++)
    {
        pair<int,int>p = M0[i];
        if(satisfyDistanceTime(workerLists[p.first],taskLists[p.second]))
            successNum++;
    }
    return successNum;
}

int main(int argc, char* argv[]){
    string file;
    if(argc!=4){
        usage();
        return 0;
    }else{
        l = atoi(argv[1]);
        r = atoi(argv[2]);
        file = string(argv[3]);
    }
    program_t begProg, endProg;
    usedMemory = 0;
    double usedTime;
    int successNum=0;
    save_time(begProg);
    successNum = baseline(file);
    save_time(endProg);
    watchSolutionOnce(getpid(), usedMemory);
    usedTime = calc_time(begProg, endProg);
    printf("Baseline %d %.6lf %d\n", successNum, usedTime, usedMemory);
    return 0;
}